Skip to content

feat: migrate implement-ticket and babysit-pr to the schema 1.3 review-result contract - #86

Merged
shaug merged 4 commits into
mainfrom
scott/55-caller-contract-migration
Jul 29, 2026
Merged

feat: migrate implement-ticket and babysit-pr to the schema 1.3 review-result contract#86
shaug merged 4 commits into
mainfrom
scott/55-caller-contract-migration

Conversation

@shaug

@shaug shaug commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Summary

Migrates implement-ticket and babysit-pr to consume the final versioned
review-result contract (schema 1.3, established by #51 -> #52 -> #53), and
proves their existing full-review/current-head gates reject stale, malformed,
unsupported-version, blocked, changes-required, and incomplete evidence
without reimplementing lens sequencing, exploration, or aggregation.

  • Bundle the canonical review-suite contract (CONTRACT.md, both schemas,
    validate.py) into skills/implement-ticket/references/review-suite/ and
    skills/babysit-pr/references/review-suite/, wired through just sync-contracts and the shared byte-identical-bundle drift test.
  • Add a canonical review-suite/scripts/review_gate.py (+ its test), synced
    the same way into each caller's scripts/: a thin consumption check that
    runs the bundled schema validator and additionally binds a
    review-code-change result to the caller's exact current head/base,
    rejecting stale schema_version, malformed shape, non-aggregate results,
    non-clean verdicts, and incomplete/stale lens_executions.
  • Update implement-ticket's review-and-merge gate / babysit-pr handoff, and
    babysit-pr's final gate and post-fix re-review prose, to require this
    validation before consuming any review result, and state explicitly that
    green CI or connector approval never substitutes for it.
  • Add focused tests (test_review_gate.py) and new eval cases in both skills
    proving each rejection scenario, plus one case proving an already-current
    clean aggregate needs no extra invented review cycle.

Acceptance criteria (from #55)

  • Tests first prove the current callers' existing full-review/current-head
    behavior, so migration cannot regress it.
  • implement-ticket rejects stale, malformed, unsupported-version,
    failed-validation, blocked, changes-required, or incomplete review
    evidence.
  • babysit-pr rejects the same invalid evidence and cannot become ready
    through green CI or connector state alone.
  • A head-changing fix rebuilds validation and invokes one fresh full
    review-code-change; callers do not manually invoke individual lenses
    (unchanged, pre-existing prose, preserved).
  • Relevant base drift invalidates affected review evidence, while proven
    unrelated drift preserves the existing risk-based behavior (unchanged,
    pre-existing prose, preserved).
  • Handoff records contain the final public aggregate evidence and no
    private evaluator/explorer data.
  • A stable fully validated current head with complete clean evidence
    progresses without an extra invented review cycle.
  • Unsupported legacy contract data fails with a clear migration action.
  • Generated bundles and documented handoffs match the final source
    contract.
  • just format, just lint, and just test pass.

Review history

Three review-code-change cycles were run against this candidate lineage:

  1. Head 501c4375d8aad136a62836c9f435441efe0b8315 vs base a247d47d...:
    changes_required (one strong_recommendation: two hand-duplicated
    review_gate.py/test copies with no drift protection).
  2. Head 1dc2a492bd3b54961b264dec84b4f00cefe5b4e3 vs base a247d47d...:
    prior finding independently verified resolved; changes_required again
    (one new strong_recommendation: the fix commit was missing its
    CHANGELOG.md entry).
  3. Head ce76e6581213c3eda1f180a99b9b6edd819ae3ef vs base a247d47d...:
    clean across all three lenses (solution simplicity, correctness,
    code simplicity), zero findings.

Out of scope / untouched

Closes #55

shaug added 4 commits July 29, 2026 06:40
…w-result contract

- Bundle the canonical review-suite contract (CONTRACT.md, both schemas,
  validate.py) into `skills/implement-ticket/references/review-suite/` and
  `skills/babysit-pr/references/review-suite/`, and wire `just sync-contracts`
  and the shared bundled-contract test to keep both byte-identical to the
  canonical source.
- Add `scripts/review_gate.py` to each caller: a thin consumption check (not a
  reviewer) that runs the bundled schema validator against a
  `review-code-change` result and additionally binds it to the caller's exact
  current head/comparison-base SHA, rejecting stale `schema_version` values,
  malformed shape, non-`aggregate` results, non-`clean` verdicts, and
  incomplete or stale `lens_executions`.
- Update `implement-ticket`'s review-and-merge gate and babysit-pr-handoff
  prose, and `babysit-pr`'s final gate and post-fix re-review prose, to require
  validating every review result against the bundled contract before consuming
  it, and to state explicitly that green CI or connector approval never
  substitutes for that validated result.
- Add focused tests for the new gate (stale/unsupported schema version,
  malformed shape, blocked/changes_required verdicts, incomplete/stale lens
  executions, wrong-candidate binding, current-clean acceptance) and new eval
  cases proving each caller blocks publication/readiness on the same
  conditions, plus a case proving an already-current clean aggregate needs no
  extra invented review cycle.

- #55 (epic #49) requires both meta-skills to correctly consume, validate, and
  reject the review-result contract at its final version (schema 1.3, from
  #51-#53) without reimplementing lens sequencing, exploration, or aggregation,
  which stay owned by `review-code-change`.
…mechanism

## Summary
- Add `review-suite/scripts/review_gate.py` and
  `review-suite/scripts/tests/test_review_gate.py` as the canonical source for
  the caller-side review-result consumption check, resolving `validate.py` in
  either the canonical or installed skill layout.
- Extend `just sync-contracts` to copy both into `implement-ticket` and
  `babysit-pr`'s `scripts/` directories, replacing the two hand-duplicated
  copies with synced ones.
- Extend `review-suite/scripts/tests/test_bundled_contracts.py` with a
  `GATE_BUNDLING_SKILLS`/`GATE_CANONICAL_FILES` check so future drift between
  the two copies fails a test the same way the four sibling bundled files
  already do.

## Why
- `review-code-change`'s own solution-simplicity and code-simplicity lenses
  found the two per-skill `review_gate.py`/test copies were byte-identical
  hand duplicates with no drift protection, unlike the four sibling bundled
  files this same change already protects with the established
  canonical-source-plus-sync-plus-drift-test pattern. This closes that gap by
  reusing the existing mechanism instead of inventing a new one.
…ation fix

- Add the missing CHANGELOG bullet for commit `1dc2a492` (the review_gate.py
  canonicalization fix) and backfill its SHA now that it is superseded.
- Backfill the SHA onto the preceding `feat: migrate implement-ticket and
  babysit-pr...` entry.

- A re-review of the #55 caller-migration candidate found the fix commit
  changed caller-consumed behavior but never recorded it in CHANGELOG.md,
  breaking this repository's otherwise-unbroken daily-changelog convention
  (AGENTS.md Git Workflow).
## Summary
- Correct the two CHANGELOG.md SHAs for the review_gate.py fix and the caller
  migration commit, which changed identity when this branch was rebased onto
  the current origin/main (a competing PR merged first, forcing a rebase to
  resolve a real CHANGELOG.md conflict).
- Every cited SHA under `## 2026-07-29` is now verified with
  `git merge-base --is-ancestor` against the current HEAD.

## Why
- A fresh review-code-change cycle, run after the rebase, found the two SHAs
  backfilled before the rebase pointed at orphaned pre-rebase commit objects
  rather than the real in-history commits, which would have broken
  traceability once the stale remote ref is superseded.
@shaug
shaug force-pushed the scott/55-caller-contract-migration branch from ce76e65 to 51cc734 Compare July 29, 2026 14:10
@shaug
shaug merged commit fa6d05f into main Jul 29, 2026
1 check passed
@shaug
shaug deleted the scott/55-caller-contract-migration branch July 29, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate caller contracts and prove current-head review integration

1 participant